#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableCopyrightFilesFilterDao:DaoBase<TableCopyrightFilesFilter>
    {
        public override string GetFileName()
        {
            return "TableCopyrightFilesFilter.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableCopyrightFilesFilter>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddTwoIndex(TableCopyrightFilesFilter model)
        {
            string key = GetUnionKey(model.fileName.ToString(),model.fileType.ToString());
            if (!cacheTwoIndex.ContainsKey(key))
            {
                cacheTwoIndex[key] = new List<TableCopyrightFilesFilter>();
            }
            cacheTwoIndex[key].Add(model);
        }
        public override void AddPrimaryIndex(TableCopyrightFilesFilter model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableCopyrightFilesFilter->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableCopyrightFilesFilter ParseRowData(string[] rowData)
        {
            TableCopyrightFilesFilter data = new TableCopyrightFilesFilter();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.fileName = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.fileType = string.Intern(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.copyrightProblem = int.Parse(rowData[3]);
            }
            return data;
        }
    }
}
